import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        params: query
    });
};

export const login = query => {
    return request({
        url: '/users/login',
        method: 'get',
        params: query
    });
};

export const getClazzData = query => {
    return request({
        url: '/clazz/getClazzPager',
        method: 'get',
        params: query
    });
};

export const delClazz = query => {
    return request({
        url: '/clazz/delClazz',
        method: 'get',
        params: query
    });
};

export const getAllClazz = query => {
    return request({
        url: '/clazz/getAllClazz',
        method: 'get',
        params: query
    });
};


export const getClazzStudents = query => {
    return request({
        url: '/student/getClazzStudents',
        method: 'get',
        params: query
    });
};

export const updateInfo = query => {
    return request({
        url: '/users/updateInfo',
        method: 'get',
        params: query
    });
};

export const getAllTeacher = query => {
    return request({
        url: '/users/getAllTeacher',
        method: 'get',
        params: query
    });
};

export const saveClazz = query => {
    return request({
        url: '/clazz/saveClazz',
        method: 'get',
        params: query
    });
};

export const getUserData = query => {
    return request({
        url: '/users/page',
        method: 'get',
        params: query
    });
};

export const delUser = query => {
    return request({
        url: '/users/delUser',
        method: 'get',
        params: query
    });
};

export const saveUser = query => {
    return request({
        url: '/users/saveUser',
        method: 'get',
        params: query
    });
};


export const getStudentData = query => {
    return request({
        url: '/student/getStudentPage',
        method: 'get',
        params: query
    });
};

export const delStudent = query => {
    return request({
        url: '/student/delStudent',
        method: 'get',
        params: query
    });
};

export const saveStudent = query => {
    return request({
        url: '/student/saveStudent',
        method: 'get',
        params: query
    });
};

export const getScoreData = query => {
    return request({
        url: '/score/getScorePage',
        method: 'get',
        params: query
    });
};


export const getUserScore = query => {
    return request({
        url: '/score/getUserScore',
        method: 'get',
        params: query
    });
};

export const delScore = query => {
    return request({
        url: '/score/delScore',
        method: 'get',
        params: query
    });
};

export const saveScore = query => {
    return request({
        url: '/score/saveScore',
        method: 'get',
        params: query
    });
};